/**
 * @filename: SendService.java 2020年1月8日
 * @project match-service  V1.0
 * Copyright(c) 2020 flying-cattle Co. Ltd.
 * All right reserved.
 */
package com.service.admin.rabbitmq.binding;

import com.service.match.common.entity.SpotOrderVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;

/**
 * @author flying-cattle
 * @ClassName: SendService
 * @date 2020年1月8日
 */
@Slf4j
@EnableBinding(MatchSink.class)
public class MatchSendHandler {

    @Autowired
    private MatchSink source;

    public void sendCancelOrder(SpotOrderVo order) {
        log.info("send cancel order:{}", order);
        source.outCancelOrder().send(MessageBuilder.withPayload(order).build());
    }

}
